Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cmake support for code coverage build type #2393

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

nsmithtt
Copy link
Contributor

@nsmithtt nsmithtt commented Mar 6, 2025

Generate a coverage report with:

lcov --ignore-errors inconsistent,format --include $(pwd) --exclude $BUILD_DIR --directory $BUILD_DIR --capture --output-file $BUILD_DIR/coverage.info
genhtml --ignore-errors inconsistent,format,category $BUILD_DIR/coverage.info -o $BUILD_DIR/coverage-site
echo "Coverage report is available at $BUILD_DIR/coverage-site/index.html"

Copy link
Contributor

@vwellsTT vwellsTT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me--will there be a follow on to flag coverage in CI or the like, or is this just for manual reporting?

@nsmithtt
Copy link
Contributor Author

nsmithtt commented Mar 6, 2025

Seems reasonable to me--will there be a follow on to flag coverage in CI or the like, or is this just for manual reporting?

I think eventually we will want to have this in CI, I'll work with @vmilosevic who's enabled this in tt-xla CI. The only drawback is CI slowdown, maybe we should just run with it as the default build config and always collect coverage stats 🤷

@nsumrakTT
Copy link
Contributor

Seems reasonable to me--will there be a follow on to flag coverage in CI or the like, or is this just for manual reporting?

I think eventually we will want to have this in CI, I'll work with @vmilosevic who's enabled this in tt-xla CI. The only drawback is CI slowdown, maybe we should just run with it as the default build config and always collect coverage stats 🤷

It won't make much time difference as code coverage should work with debug version (-O0) in order to have good results. Debug build is done on ubuntu-latest as a side show in tt-mlir CI. Open questions are about the size of the build and whether it will fit ubuntu-latest as coverage add symbols to the build, and also definition of code coverage because basically it should run only on unit tests (should not require hardware).

@nsmithtt nsmithtt merged commit 3854d54 into main Mar 7, 2025
34 checks passed
@nsmithtt nsmithtt deleted the nsmith/coverage-target branch March 7, 2025 21:41
odjuricicTT pushed a commit that referenced this pull request Mar 8, 2025
Generate a coverage report with:

```bash
lcov --ignore-errors inconsistent,format --include $(pwd) --exclude $BUILD_DIR --directory $BUILD_DIR --capture --output-file $BUILD_DIR/coverage.info
genhtml --ignore-errors inconsistent,format,category $BUILD_DIR/coverage.info -o $BUILD_DIR/coverage-site
echo "Coverage report is available at $BUILD_DIR/coverage-site/index.html"
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants